<html>
 <head>
	<title>[var.TITLE]</title>
	<link href="[var.ROOT_CSS_DIR]/main.css" rel="STYLESHEET" type="text/css" charset="iso-8859-1" hreflang="en-us">
	<link href="[var.ROOT_CSS_DIR]/facet/style.css" rel="STYLESHEET" type="text/css" charset="iso-8859-1" hreflang="en-us">	
 </head>
 <body bgcolor="FFFFFF" topmargin="0" leftmargin="0" marginheight="0" marginwidth="0">
	<table border="0" cellspacing="0" cellpadding="0" width="100%" align="[var.POSITION]">
		<tr height="100%">
			<td>
			<table border="0" cellspacing="0" cellpadding="0" width="100%" height="100%">
				<tr valign="top">
					<td width="100%">
						<table border="0" cellspacing="0" cellpadding="5" width="100%">
							<tr>
								<td class="FacetHeaderContent" align="left">.:BL Lookup:. </td>
							</tr>
						</table>
						<table border="0" cellspacing="0" cellpadding="5" width="100%">
							<tr>
								<td class="contentTitle">[tbs_check;block=tr;if [var.USER_CANINSERT]=1]
								Menu
								</td>
							</tr>
							<tr>
								<td class="content2">[tbs_check;block=tr;if [var.USER_CANINSERT]=1]
								<table cellspacing="2" cellpadding="0">
								 <tr>
								   <td>
								     <input type="button" name="Action" value="Close" class="button" onClick="self.close()">
								   </td>
								 </tr>
								</table>
								</td>
							</tr>
							<tr>
								<td class="content2">
									<table border="0" cellspacing="0" cellpadding="0">
									<form  method="post" action="[var.FileName]?FormName=[var.FormName]&blCodeSearch=[var.FCode]&curr=[var.FCurr]&vessel=[var.FVessel]&voyage=[var.FVoyage]">
										<tr>
											<td class="fieldCaption">BL Code</td>
											<td class="fieldCaption">:</td>
											<td>
											<input type="text" name="blCodeSearch" size="35" maxlength="50" class="input" value="[var.FCode]">
                      <input type="hidden" name="SendToBack" value="1">
											</td>
										</tr>										
										<tr>
											<td class="menuHeader"></td>
											<td class="menuHeader"></td>
											<td align="right">
											<input type="submit" name="Action" value="Search" class="button" >
											</td>
										</tr>
									</form>
									</table>								
								</td>
							</tr>
							<tr>
								<td>
								</td>
							</tr>														
							<tr>
								<td >&nbsp;</td>
							</tr>							
						</table>					
						<table border="0" cellspacing="0" cellpadding="0" width="100%">
						    <tr>
						      <td>
						 <!-- GRID SECTION -->
									<table border="0" width="100%" cellpadding="3" cellspacing="1" class="FacetFormTABLE" align="left">
									<form method=post name="[var.HTMLGridList]" >
									  <tr>
									  	<td nowrap class="FacetColumnTD" align="center"></td>
									    <td nowrap class="FacetColumnTD" align="center">Code.</td>
									    <td nowrap class="FacetColumnTD" align="center">Debtur</td>
									    <td nowrap class="FacetColumnTD" align="center">Date</td>
									    <td nowrap class="FacetColumnTD" align="center">Total</td>
									  </tr>
									    <script>
									    	var nList=[var.PageNum]*[var.PageSize]-[var.PageSize];
									    	var nStart=nList+1;
									    </script>
									  <tr>
									    <td nowrap class="FacetDataTD" width="20">
									    <input type="checkbox" name="txtCheck[blg.#]" value="[blg.BLNO]" class="inputRadio" onclick="TransferData('[blg.BLNO]','ais_transaction_dnbook.php?PageMode=TransferRPC&blno=[blg.BLNO]&idx='+opener.idx,this.checked)">
									    </td>
									    <td class="FacetDataTD">[blg.BLNO]</td>
									    <td class="FacetDataTD">[blg.DEBITORCODE;block=tr;]</td>
									    <td class="FacetDataTD">[blg.BLDATE;frm='dd/mm/yyyy']</td>
									    <td class="FacetDataTD" align="right">[blg.BLTOTAL;frm='0,000.00']</td>
									    <script>
									    	nList++;
									    </script>
									  </tr>

									  <tr>
									    <td colspan="8" class="FacetDataTD">[blg;block=tr;nodata]No records</td>
									  </tr>

									  <tr>
									    <td colspan="8" nowrap class="FacetColumnTD">[tbs_check.1;block=tr;if [var.RecCnt]!=0]
											<table border="0" align="left" cellpadding="0" cellspacing="0">
											  <tr align="center">[tbs_check.1;block=table;if [var.RecCnt]!=0]
											    <td width="16" class="FacetColumnTD"><a href="[sys.script_name]?PageNum=[nv.first;endpoint;friend2=a]&FormName=[var.FormName]&custCodeSearch=[var.FCode]&SendToBack=1">|&lt;</a></td>
											    <td width="16" class="FacetColumnTD"><a href="[sys.script_name]?PageNum=[nv.prev;endpoint;friend2=a]&FormName=[var.FormName]&custCodeSearch=[var.FCode]&SendToBack=1">&lt;</a></td>
											    <td width="16" class="FacetColumnTD"><a href="[sys.script_name]?PageNum=[nv.page;block=td]&FormName=[var.FormName]&custCodeSearch=[var.FCode]&SendToBack=1">[nv.page]</a></td>
											    <td width="16" bgcolor="#B7B3B7"><strong>[nv.page;block=td;currpage]</strong></td>
											    <td width="16" class="FacetColumnTD"><a href="[sys.script_name]?PageNum=[nv.next;endpoint;friend2=a]&FormName=[var.FormName]&custCodeSearch=[var.FCode]&SendToBack=1">&gt;</a></td>
											    <td width="16" class="FacetColumnTD"><a href="[sys.script_name]?PageNum=[nv.last;endpoint;friend2=a]&FormName=[var.FormName]&custCodeSearch=[var.FCode]&SendToBack=1">&gt;|</a></td>
											  </tr>
											</table>									    
									    </td>
									  </tr>
									  </form>
									</table>
						<!-- GRID SECTION -->												 
						       </td>						      
						 	</tr>
						 	<tr>
						 	  <td>
						 	  &nbsp;
						 	  </td>
						 	</tr>
							</table>
					</td>
				</tr>
			</table>

			</td>
		</tr>
 	</table>
 </body>
<script>
GettingList()
function LoadContent(file){	
  var scriptTag = document.getElementById('loadScript');
  var head = document.getElementsByTagName('head').item(0)
  if(scriptTag) head.removeChild(scriptTag);
  script = document.createElement('script');
  script.src = file;
  script.type = 'text/javascript';
  script.id = 'loadScript';
  window.status = "Loading...";
  head.appendChild(script)
	window.status = "";    
}
function isExist(primary_key) {
	var retval = false;
	for (x=0;x<opener.key_hash.length;x++){
		if (opener.key_hash[x]==primary_key) {
			retval = true;
			break;
		}
	}
	return retval;
}
function GettingList() {
	for (n=nStart;n<=nList;n++) {
		streval = "if (isExist(document.[var.HTMLGridList].txtCheck"+n+".value)) {document.[var.HTMLGridList].txtCheck"+n+".checked=true} else {document.[var.HTMLGridList].txtCheck"+n+".checked=false}";
		eval(streval);
	}
}
function TransferData(primary_key, urlstr, flagchecked) {
	if (!isExist(primary_key)) {
		if (flagchecked) {
			LoadContent(urlstr);
			opener.key_hash[opener.key_hash.length] = primary_key;
		}
	}
}
</script>
</html>
